<!--
 * @description  : 品规详情
 * @descriptionDetail: 品规详情
 * @copyright    : 浙江烟草
 * @author       : lt
 * @create       : 2022-12-26 08:01:38
-->

<template>
  <view class="page">
    <!-- #ifdef H5-ONLY -->
    <theme-navbar
      :is-white="false"
      :title="navTitle"
      :custom-back="goBack"
      style="z-index: 99999"
    >
    </theme-navbar>
    <!-- #endif -->  
  
    <u-card
      margin="20rpx"
      thumb="../../../../static/check/pending-approval.png"
      thumb-width="38"
      box-shadow="#e5e5e5 0px 0px 50px"
      :show-head="false"
      :show-foot="false"
    >      
      <template #body> 
        <u-form :model="formData"> 
          <u-row style="margin-bottom:16px;">
            <u-col span="1.5">
              <u-image style="width:25px;height:25px;" src="../../../static/cigar/icon_yc.png"></u-image>
            </u-col>
            <u-col span="10">
              <p style="font-size:30rpx;font-weight:bold;color:#333333;text-align:left;">
                {{ formData.productName }}
              </p>
            </u-col>
          </u-row>
          <u-row gutter="12" style="margin-bottom:8px;">
            <u-col span="4">
              <span class="left">
                {{ formData.riskBrandTypeName }}
              </span>
            </u-col>
            <u-col span="6"> 
              <span class="middle">
                风险指数：{{ formData.riskIndex }}
              </span>
            </u-col>
            <u-col span="2"> 
              <span class="right">
                画像
              </span>
            </u-col>
          </u-row>
        </u-form>        
      </template>       
    </u-card>   
 
    <u-card
      margin="20rpx"
      thumb="../../../../static/check/pending-approval.png"
      thumb-width="38"
      box-shadow="#e5e5e5 0px 0px 50px"
      :show-head="false"
      :show-foot="false"
    > 
      <template #body>
        <div class="title">
          品规查询
        </div>
        <u-grid :col="3" :border="false">
          <u-grid-item @click="findBaseInfo">
            <u-image style="width:29px;height:29px;" src="../../../static/cigar/icon_base.png"></u-image>
            <view class="grid-text">
              基础信息
            </view>
          </u-grid-item>
          <u-grid-item @click="findSaleQty">
            <u-image style="width:29px;height:29px;" src="../../../static/cigar/icon_xl.png"></u-image>
            <view class="grid-text">
              销量
            </view>
          </u-grid-item>
          <u-grid-item @click="findOutFlow">
            <u-image style="width:29px;height:29px;" src="../../../static/cigar/icon_wl.png"></u-image>
            <view class="grid-text">
              外流
            </view>
          </u-grid-item>
        </u-grid>
        <u-grid :col="3" :border="false">
          <u-grid-item @click="findOutFlowCust">
            <u-image style="width:29px;height:29px;" src="../../../static/cigar/icon_wlh.png"></u-image>
            <view class="grid-text">
              外流户
            </view>
          </u-grid-item>
          <u-grid-item @click="findCigarSeisure">
            <u-image style="width:29px;height:29px;" src="../../../static/cigar/icon_ck.png"></u-image>
            <view class="grid-text">
              查扣
            </view>
          </u-grid-item>
          <u-grid-item @click="findCigarWarnInfo">
            <u-image style="width:29px;height:29px;" src="../../../static/cigar/icon_yj.png"></u-image>
            <view class="grid-text">
              预警
            </view>
          </u-grid-item>
        </u-grid>
      </template>
    </u-card> 
  </view> 
</template>
<script>
export default {
  components:{},
  data() {
    return { 
      formData: { 
        productUuid: "",
        riskIndex: "",
        orgUuid: "",
        productName: "",
        riskBrandTypeName: "",
        stripCode: "",
        warnEndDate:'',
        warnBeginDate:'',
      },
    };
  },
  onLoad(obj) {
    this.formData.productUuid = obj.productUuid;
    this.formData.orgUuid = this.$storage.get(this.$rp.common.USER).user.org.orgUuid;
    this.formData.riskIndex = obj.riskIndex;
    this.formData.productName = obj.productName;
    this.formData.riskBrandTypeName = obj.riskBrandTypeName;
    this.formData.stripCode = obj.stripCode;
    this.formData.warnEndDate = obj.warnEndDate;
    this.formData.warnBeginDate = obj.warnBeginDate;
  },
  onReady() {
  },
  // 页面加载成功后也要设置一次，用于处理本页面刷新后失效问题
  mounted() {   
  },
  created () {
    console.log(this.$toast);
  },
  methods: {
    // 基本信息
    findBaseInfo() {
      this.$u.route("/pages/internal/cigar/cigarBaseInfo",{
        productUuid: this.formData.productUuid,
      });
    },
    // 销量
    findSaleQty(){
      this.$u.route("/pages/internal/cigar/cigarSaleQty",{
        productName: this.formData.productName,
        warnBeginDate: this.formData.warnBeginDate,
        warnEndDate: this.formData.warnEndDate,
        stripCode: this.formData.stripCode,

      });
    },
    // 卷烟外流
    findOutFlow(){
      this.$u.route("/pages/internal/cigar/cigarOutFlow",{
        productName: this.formData.productName,
        stripCode: this.formData.stripCode,
        warnBeginDate: this.formData.warnBeginDate,
        warnEndDate: this.formData.warnEndDate,
      });
    },
    // 卷烟外流户
    findOutFlowCust(){
      this.$u.route("/pages/internal/cigar/cigarOutFlowCust",{
        productName: this.formData.productName,
        stripCode: this.formData.stripCode,
        warnBeginDate: this.formData.warnBeginDate,
        warnEndDate: this.formData.warnEndDate,
      });
    },
    // 卷烟查扣
    findCigarSeisure(){
      this.$u.route("/pages/internal/cigar/cigarSeisure",{
        productName: this.formData.productName,
        stripCode: this.formData.stripCode,
        warnBeginDate: this.formData.warnBeginDate,
        warnEndDate: this.formData.warnEndDate,
      });
    },
    // 卷烟预警
    findCigarWarnInfo(){
      this.$u.route("/pages/internal/cigar/cigarWarnInfo",{
        productName: this.formData.productName,
        stripCode: this.formData.stripCode,
        warnBeginDate: this.formData.warnBeginDate,
        warnEndDate: this.formData.warnEndDate,
      });
    },
  },
};
</script>
<style lang="scss" scoped>
@import "@/style/common/rightMenu.scss";
    .wrap {
        padding: 32px;
    }
    .demo-layout {
        height: 25px;
        border-radius: 4px;
    }

    .bg-purple {
        background: #CED7E1;
        padding: 32px;
        margin: 30px;
    }

    .bg-purple-dark {
        background: #99a9bf;
    }
    p{
      text-align: center;
    }
    .tableView {
      min-height: 0px;
    }
    .grid-text{    
      font-size: 16px;
      font-family: ".PingFang SC";
      font-weight: 500;
      color: #696A7C;
      opacity: 1;
      margin-top: 14px;
    }
    .title{
      width: 90px;
      height: 30px;
      font-size: 22px;
      font-family: ".PingFang SC";
      font-weight: 600;
      line-height: 0px;
      color: #121C33;
      opacity: 1;
      padding-left: 15px;
      padding-top: 29px;
    }
    .left{
      background: #EFF3F9;
      opacity: 1;
      border-radius: 5px;
      font-size: 3vw;
      font-family: ".PingFang SC";
      font-weight: 400;
      color: #666680;
      opacity: 1;
      padding:5px 8%;
    }
    .middle{
      background: #EFF3F9;
      opacity: 1;
      border-radius: 5px;
      font-size: 3vw;
      font-family: ".PingFang SC";
      font-weight: 400;
      color: #666680;
      opacity: 1;
      padding:5px 10%;
    }
    .right{
      background: rgba(2, 122, 255, 0.16);
      opacity: 1;
      border-radius: 5px;
      font-size: 3vw;
      font-family: ".PingFang SC";
      font-weight: 600;
      color: #027AFF;
      opacity: 1;
      padding:5px 8%;
    }
</style>